﻿Imports System
Imports System.Text.RegularExpressions
Imports System.Web.UI.Page

Public Class ShopList
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Request.Params("Tag") = Nothing Or Request.Params("Tag") = "" Then
            ShopDB.SelectCommand = "SELECT * FROM Shops"
        Else
            ShopDB.SelectCommand = "SELECT DISTINCT [ShopName], [Photo], [Rating], [LastReviewDate], [PostCode], [URL], [ID] FROM [ShopTagView] WHERE ([Tag] = ?)"
        End If
    End Sub

    Protected Function getRating(ByVal rating As Integer)
        Dim retval As String
        retval = ""
        For i = 1 To rating
            retval = retval + "*"
        Next
        Return retval
    End Function

End Class